
#include "CPerson.h"
#include <iostream>  
#include <string>

using namespace std;


CPerson::~CPerson()
{

}


void CPerson::talk()
{
    cout << myName << "\t is talking" << endl;
    
    if (myCommand.itsPerson != NULL)
    {
        myCommand.execute();    
    }
}


void CPerson::passOn()
{
    cout << myName << "\t is passing on" << endl;
    
    if (myCommand.itsPerson != NULL)
    {
        myCommand.execute();    
    }
}


void CPerson::gossip()
{
    cout << myName << "\t is gossiping" << endl;
    
    if (myCommand.itsPerson != NULL)
    {
        myCommand.execute();    
    }
}


void CPerson::listen()
{
    cout << myName << "\t is listening" << endl;
    
    if (myCommand.itsPerson != NULL)
    {
        myCommand.execute();    
    }
}
